//
// Created by Tan Ke on 2024/2/22.
//

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

void sortColors(int* nums, int numsSize)
{
    int colorCnt[3] = {0};
    int index = 0;

    for (int i = 0; i < 3; i ++) {
        colorCnt[i] = 0;
    }

    for (int i = 0; i < numsSize; i ++) {
        colorCnt[nums[i]] += 1;
    }

    for (index = 0; index < colorCnt[0]; index ++) {
        nums[index] = 0;
    }

    for (; index < colorCnt[0] + colorCnt[1]; index ++) {
        nums[index] = 1;
    }

    for (; index < colorCnt[0] + colorCnt[1] + colorCnt[2]; index ++) {
        nums[index] = 2;
    }
}

int main(void)
{
    return 0;
}